package edu.xlh.travel.websocket.service.impl;

import edu.xlh.travel.websocket.dao.FriendInfoDao;
import edu.xlh.travel.websocket.domin.FriendInfo;
import edu.xlh.travel.websocket.service.FriendInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class FriendInfoServiceImpl implements FriendInfoService {
    @Autowired
    private FriendInfoDao friendInfoDao;
    @Override
    public FriendInfo findOneById(String friendGroupId) {
        return friendInfoDao.getOne(friendGroupId);
    }

    @Override
    public List<FriendInfo> findAll() {
        return friendInfoDao.findAll();
    }

    @Override
    public List<FriendInfo> findAllExcludeOwner(String ownerGroupName) {
        return friendInfoDao.findByGroupnameNot(ownerGroupName);
    }
}
